﻿

@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <title>登录</title>
    <link rel="stylesheet" type="text/css" href="~/css/bootstrap/bootstrap.min.css" />
    <script src="~/js/demo-rtl.js"></script>
    <link rel="stylesheet" type="text/css" href="~/css/libs/font-awesome.css" />
    <link rel="stylesheet" type="text/css" href="~/css/libs/nanoscroller.css" />
    <link rel="stylesheet" type="text/css" href="~/css/compiled/theme_styles.css" />
    <!--[if lt IE 9]>
            <script src="~/js/html5shiv.js"></script>
            <script src="~/js/respond.min.js" ></script>
        <![endif]-->
    <link href="~/Scripts/plugins/layer/skin/layer.css" rel="stylesheet" />
    <link href="~/Scripts/plugins/layer/skin/layer.ext.css" rel="stylesheet" />
</head>
<body id="login-page-full">
    <div id="login-full-wrapper">
        <div class="container">
            <div class="row">
                <div class="col-xs-12">
                    <div id="login-box">
                        <div id="login-box-holder">
                            <div class="row">
                                <div class="col-xs-12">
                                    <header id="login-header">
                                        <div id="login-logo">
                                            <img src="~/img/logo.png" alt="" />
                                        </div>
                                    </header>

                                    <div id="login-box-inner">
                                        <form role="form" id="loginForm" action="/login/login" method="post">
                                            <div class="input-group">
                                                <span class="input-group-addon"><i class="fa fa-user"></i></span>
                                                <input class="form-control" type="text" id="username" name="username" placeholder="请输入用户账号">
                                            </div>
                                            <div class="input-group">
                                                <span class="input-group-addon"><i class="fa fa-key"></i></span>
                                                <input type="password" class="form-control" id="password" name="password" placeholder="请输入用户密码">
                                            </div>
                                            <div id="remember-me-wrapper">
                                                <div class="row">
                                                    <div class="col-xs-6">
                                                        <div class="checkbox-nice">
                                                            <input type="checkbox" id="remember-me" checked="checked" />
                                                            <label for="remember-me">
                                                                记住我
                                                            </label>
                                                        </div>
                                                    </div>
                                                    <a href="forgot-password-full.html" id="login-forget-link" class="col-xs-6">
                                                        忘记密码?
                                                    </a>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-xs-12">
                                                    <button type="button" id="btnLogin" class="btn btn-success col-xs-12">登录</button>
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>

                    </div>
                </div>
            </div>
        </div>
    </div>
    <script src="~/js/demo-skin-changer.js"></script>
    <script src="~/js/jquery.js"></script>
    <script src="~/js/bootstrap.js"></script>
    <script src="http://apps.bdimg.com/libs/layer.m/1.5/layer.m.js"></script>
  
    <script>
  
   $(function () {
            
       $("body").on('keypress', function (e) {

           if (e.keyCode == 13) {
               Login();
           }
       });
      
       $("#btnLogin").click(function () {
           Login();

       });
   });
   function Login() {
       var username = $("#username");
       var password = $("#password");

       if (username.val() === "") {
           layer.open({
               content: '用户名不能为空',
               style: 'background:rgba(0,0,0, .6); color:#fff; border:none;',
               time: 2,
               shade: false
           });

           username.focus();
           return false;
       }

       if (password.val() === "") {
           layer.open({
               content: '密码不能为空',
               style: 'background:rgba(0,0,0, .6); color:#fff; border:none;',
               time: 2,
               shade: false
           });

           password.focus();
           return false;
       }


       $.ajax({
           type: "post",
           url: "/logined.html",
           data: {
               UserName: username.val(), Password: password.val()
           },
           dataType: "json",
           success: function (data)
           {
               if (data && data.State) {
                   window.location.href = '/index.html'
               } else {
                   layer.open({
                       content: data.Message,
                       style: 'background:rgba(0,0,0, .6); color:#fff; border:none;',
                       time: 2,
                       shade: false
                   });

               }

           }
       });


      
   }
    </script>
    @*</script>
        $(function () {
            var bttnJelly = document.getElementById('loginid');
            bttnJelly.addEventListener('click', function () {
                if ($("#UserName").val() == "" || $("#password").val() == "") {
                    alert("请输入正确的用户账号和密码！");
                } else {
                    $("#loginForm").submit();
                }
            });
        });
    </script>*@
</body>
</html>
